package com.ygou.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ygou.mapper.OrdergoodsMapper;
import com.ygou.pojo.Ordergoods;
import com.ygou.pojo.OrdergoodsExample;
import com.ygou.pojo.OrdergoodsExample.Criteria;
import com.ygou.service.OrderGoodsService;

@Service
public class OrderGoodsServiceImpl implements OrderGoodsService {

	@Autowired
	private OrdergoodsMapper orderGoodsMapper;
	
	@Override
	public List<Ordergoods> selectByExample(Ordergoods orderGoods) {
		OrdergoodsExample example=new OrdergoodsExample();
		Criteria c = example.createCriteria();
		//根据订单编号查
		if(orderGoods.getOrderid()!=0&&orderGoods.getOrderid()!=null){
			c.andOrderidEqualTo(orderGoods.getOrderid());
		}
		return orderGoodsMapper.selectByExample(example);
	}

}
